Changing curvature with tension

Bezier spline is a cubic curve. Therefore, you need four points for full specification. However, every Bezier segment in previous examples was defined only by two endpoints. It means that {\logo META}{\logo FONT} has its own algorithm for finding the remaining two points. If you want to control the curvature, you must have the possibility to influence this algorithm. One way is to use tension.

You can define tension at any point of any segment. The general syntax is

z1..tension a and b..z2
If a = b, we can simplify this to
z1..tension a..z2
The simple case z1..z2 is a shorthand for1
z1..tension 1..z2

Figure: Frame
\begin{figure}
\centerline{{\DW abc}}\vspace{5mm}\par
\end{figure}
In the next example, we will need some more definitions. You should already understand the first two lines. The next line defines some parameters which will be used later. Then we declare the array of paths to be drawn, the array of cnt and pen widths which are both numeric variables. Then we assign some values to them.
\begin{mfcode}
height ...
Afterwards we have to specify a number of points and the three curves. We will use a predefined constant origin which means (0,0). To simplify the task we also use loops. The loop starts with the for token and carries out the commands up to endfor for the specified values of the loop control variable. In the firs loop, when k = 1, the inner loop defines points z20, z21,…, z32. The token shifted means that the point is shifted by the specified vector. The vectors right, left, up, down, are the unit vectors in the named direction. The token scaled means scaling (multiplication) of the vector. In the equations below it defines the length of the vector.

The definition of paths (curves) end with cycle. This means that the curve is cyclical. If you say

draw z1..z2..z3..z1;
the curve will most probably have a sharp edge at z1. You must say
draw z1..z2..z3..cycle;
in order to make the curve smooth.


\begin{mfcode}
z0=origin; z1=(0,height); z2=(width,height); z3=(width,0);
z5=....
...
tension tens and 1..z[m+12]..tension 1 and tens..cycle;
endfor;
\end{mfcode}

Now we draw the curves. Notice that we used zero widths for the first two characters in order to simplify overlapping (look how fig. [*] was done).


\begin{mfcode}
beginchar (''a'',0,height ...